{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Highcharts Demos\n",
    "==========\n",
    "Spline with inverted axes: http://www.highcharts.com/demo/spline-inverted\n",
    "----------------------------------------------------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<iframe style=\"border:0;outline:none;overflow:hidden\" srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;utf-8&quot; /&gt;\n",
       "        &lt;link href=&quot;https://www.highcharts.com/highslide/highslide.css&quot; rel=&quot;stylesheet&quot; /&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts-more.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;/head&gt;\n",
       "    &lt;body style=&quot;margin:0;padding:0&quot;&gt;\n",
       "                &lt;div id=&quot;container&quot; style=&quot;&quot;&gt;Loading....&lt;/div&gt;\n",
       "\n",
       "\n",
       "    &lt;script&gt;\n",
       "        $(function(){\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "            Highcharts.setOptions({&quot;lang&quot;: {}, &quot;global&quot;: {}});\n",
       "            var option = {&quot;loading&quot;: {}, &quot;subtitle&quot;: {&quot;text&quot;: &quot;According to the Standard Atmosphere Model&quot;}, &quot;xAxis&quot;: {&quot;reversed&quot;: false, &quot;labels&quot;: {&quot;formatter&quot;: function () {                                return this.value + &quot;km&quot;;                            }}, &quot;showLastLabel&quot;: true, &quot;maxPadding&quot;: 0.05, &quot;title&quot;: {&quot;text&quot;: &quot;Altitude&quot;, &quot;enabled&quot;: true}}, &quot;title&quot;: {&quot;text&quot;: &quot;Atmosphere Temperature by Altitude&quot;}, &quot;series&quot;: {}, &quot;labels&quot;: {}, &quot;yAxis&quot;: {&quot;labels&quot;: {&quot;formatter&quot;: function () {                                                return this.value + &#x27;°&#x27;;                                            }}, &quot;lineWidth&quot;: 2, &quot;title&quot;: {&quot;text&quot;: &quot;Temperature&quot;}}, &quot;chart&quot;: {&quot;renderTo&quot;: &quot;container&quot;, &quot;inverted&quot;: true}, &quot;tooltip&quot;: {&quot;headerFormat&quot;: &quot;&lt;b&gt;{series.name}&lt;/b&gt;&lt;br/&gt;&quot;, &quot;pointFormat&quot;: &quot;{point.x} km: {point.y}\\u00b0C&quot;}, &quot;plotOptions&quot;: {}, &quot;credits&quot;: {&quot;enabled&quot;: false}, &quot;colors&quot;: {}, &quot;pane&quot;: {}, &quot;exporting&quot;: {}, &quot;drilldown&quot;: {}, &quot;navigation&quot;: {}, &quot;legend&quot;: {&quot;enabled&quot;: false}};\n",
       "\n",
       "\n",
       "            var data = [{&quot;name&quot;: &quot;Temperature&quot;, &quot;marker&quot;: {&quot;enabled&quot;: false}, &quot;type&quot;: &quot;spline&quot;, &quot;data&quot;: [[0, 15], [10, -50], [20, -56.5], [30, -46.5], [40, -22.1], [50, -2.5], [60, -27.7], [70, -55.7], [80, -76.5]]}];\n",
       "            option.series = data;\n",
       "\n",
       " \n",
       "\n",
       "            var chart = new Highcharts.Chart(option);\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "        \n",
       "    });\n",
       "        &lt;/script&gt;\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt; \"height= 520 width = 820></iframe>"
      ],
      "text/plain": [
       "<highcharts.highcharts.highcharts.Highchart at 0x7f24d1309550>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from highcharts import Highchart\n",
    "H = Highchart()\n",
    "\n",
    "# set option \n",
    "H.set_options('chart', {'inverted': True})\n",
    "\n",
    "# highchart option can be also set as a dict object\n",
    "# first construct the dict object for all the options:\n",
    "options = {\n",
    "    'title': {\n",
    "        'text': 'Atmosphere Temperature by Altitude'\n",
    "    },\n",
    "    'subtitle': {\n",
    "        'text': 'According to the Standard Atmosphere Model'\n",
    "    },\n",
    "    'xAxis': {\n",
    "        'reversed': False,\n",
    "        'title': {\n",
    "            'enabled': True,\n",
    "            'text': 'Altitude'\n",
    "        },\n",
    "        'labels': {\n",
    "            'formatter': 'function () {\\\n",
    "                                return this.value + \"km\";\\\n",
    "                            }'\n",
    "        },\n",
    "        'maxPadding': 0.05,\n",
    "        'showLastLabel': True\n",
    "    },\n",
    "    'yAxis': {\n",
    "        'title': {\n",
    "            'text': 'Temperature'\n",
    "        },\n",
    "        'labels': {\n",
    "            \"formatter\": u\"function () {\\\n",
    "                                                return this.value + '°';\\\n",
    "                                            }\"\n",
    "        },\n",
    "        'lineWidth': 2\n",
    "    },\n",
    "    'legend': {\n",
    "        'enabled': False\n",
    "    },\n",
    "    'tooltip': {\n",
    "        'headerFormat': '<b>{series.name}</b><br/>',\n",
    "        'pointFormat': '{point.x} km: {point.y}°C'\n",
    "    }\n",
    "}\n",
    "# then input using set_dict_options method\n",
    "H.set_dict_options(options)\n",
    "data =  [[0, 15], [10, -50], [20, -56.5], [30, -46.5], [40, -22.1], \n",
    "\t\t[50, -2.5], [60, -27.7], [70, -55.7], [80, -76.5]]\n",
    "H.add_data_set(data, 'spline', 'Temperature', marker={'enabled': False}) \n",
    "\n",
    "H"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
